package mt.client;

import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

public class MiddlePanel extends JPanel{
	
	/**
	 * The middle panel was thought to aggregate all the functions related to order
	 * 
	 * @author group 55
	 */


	/**
	 * responsible for create and send a buy order
	 */
	private JButton buy;
	/**
	 * responsible for create and send a sell order
	 */
	private JButton sell;
	/**
	 * responsible for create a new window and display all order received so far
	 */
	private JButton viewOrders;
	
	private JButton history;
	/**
	 * 
	 * @param buy        responsible for create and send a buy order
	 * @param sell       responsible for create and send a sell order
	 * @param viewOrders responsible for create a new window and display all order received so far
	 *
	 */
	public MiddlePanel(){
		history = new JButton("History");
		history.setEnabled(false);
		buy = new JButton("Buy");
		buy.setEnabled(false);
		sell = new JButton("Sell");
		sell.setEnabled(false);
		viewOrders = new JButton("View Orders");
		config();
	}

	public JButton getHistory() {
		return history;
	}

	public void setHistory(JButton history) {
		this.history = history;
	}

	/**
	 * procedure responsible for the layout configuration 
	 */
	private void config(){
		setLayout(new GridLayout(4,1));
		add(buy);
		add(sell);
		add(viewOrders);
		add(history);
	}

	public JButton getBuy() {
		return buy;
	}

	public JButton getSell() {
		return sell;
	}

	public JButton getViewOrders() {
		return viewOrders;
	}
}


